package com.oocl.memory;

import java.util.ArrayList;
import java.util.List;

public class SystemMemory {

	public static SystemMemory systemMemory;
	//存储拉黑商家ID
	private static List<String> banList = new ArrayList<>();
	
	public static SystemMemory getInstance(){
		if (systemMemory==null) {
			synchronized (SystemMemory.class) {
				if (systemMemory==null) {
					systemMemory = new SystemMemory();
				}
			}
		}
		return systemMemory;
	}
	
	public static void addBanLists(List<String> list){
		for (String string : list) {
			banList.add(string);
		}
	}
	
	public static void addBanList(String mId){
		banList.add(mId);
	}
	
	public static void removeBanList(String mId){
		banList.remove(mId);
	}
	
	public static List<String> getBanList(){
		return banList;
	}
	
	public static boolean isBan(String mId){
		if (banList==null) {
			return false;
		}
		for (String str : banList) {
			if (str.equals(mId)) {
				return true;
			}
		}
		return false;
	}
	
}
